from django.http import HttpResponse
from django.template import loader
from django.test import TestCase

# Create your tests here.
def generate_test_html():
    '''测试生成静态页面'''
    template = loader.get_template('test3.html')
    context = {
        'city': '北京',
        'tianqi': '晴'
    }
    html_str = template.render(context)
    print(html_str)

    # 保存生成的静态内容到：front_end_pc/test3.html
    file_path = '/home/python/PycharmProjects/meiduo/front_end_pc/test3.html'
    with open(file_path, 'w') as file:
        file.write(html_str)
